<template>
  <div id="PropertyCode">
    <v-detail
      :detailData="inputData.detailData"
      :inputConfig="inputConfig"
      :rules="rules"
      ref="input"
    ></v-detail>
  </div>
</template>

<script>
import detail from "commons/Detail";
import baseMixin from "@/mixins/BaseMixin";

export default {
  name: "PropertyCode",
  mixins: [baseMixin],
  props: {
    inputData: {
      type: Object
    }
  },
  data () {
    return {
      rules: {
        lottable01label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '01', trigger: 'blur' },
        ],
        lottable02label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '02', trigger: 'blur' },
        ],
        lottable03label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '03', trigger: 'blur' },
        ],
        lottable04label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '04', trigger: 'blur' },
        ],
        lottable05label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '05', trigger: 'blur' },
        ],
        lottable06label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '06', trigger: 'blur' },
        ],
        lottable07label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '07', trigger: 'blur' },
        ],
        lottable08label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '08', trigger: 'blur' },
        ],
        lottable09label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '09', trigger: 'blur' },
        ],
        lottable10label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '10', trigger: 'blur' },
        ],
        lottable11label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '11', trigger: 'blur' },
        ],
        lottable12label: [
          { required: true, message: this.$inputPlease("config.batchProp") + '12', trigger: 'blur' },
        ],
      },
      whseidflag: false
    }
  },
  computed: {
    inputConfig () {
      return [
        [
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'01'}),
            props: "lottable01label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'02'}),
            props: "lottable02label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'03'}),
            props: "lottable03label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'04'}),
            props: "lottable04label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'05'}),
            props: "lottable05label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'06'}),
            props: "lottable06label",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'07'}),
            props: "lottable07label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'08'}),
            props: "lottable08label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'09'}),
            props: "lottable09label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'10'}),
            props: "lottable10label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'11'}),
            props: "lottable11label",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.batchProp',{no:'12'}),
            props: "lottable12label",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "input",
            label: this.$t('config.barCode',{no:'01'}),
            props: "busr1",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'02'}),
            props: "busr2",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'03'}),
            props: "busr3",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'04'}),
            props: "busr4",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'05'}),
            props: "busr5",
            disabled: this.whseidflag
          },
        ],
        [
          {
            type: "input",
            label: this.$t('config.barCode',{no:'06'}),
            props: "busr6",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'07'}),
            props: "busr7",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'08'}),
            props: "busr8",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'09'}),
            props: "busr9",
            disabled: this.whseidflag
          },
          {
            type: "input",
            label: this.$t('config.barCode',{no:'10'}),
            props: "busr10",
            disabled: this.whseidflag
          }
        ]
      ]
    }
  },
  methods: {},
  mounted () {
    if (this.$store.state.wms.toUpperCase().includes('WMWHSE')) {
      //仓库级
      this.whseidflag = true;
    }
  },
  components: {
    "v-detail": detail
  }
}
</script>

<style scoped>
</style>
